package com.cpimex.eprice.model;

import javax.servlet.http.*;

public class Session {

    private HttpSession sesion;
    private final String USUARIO = "usuario";
    private String str_idSession;


    public boolean validaSesion(HttpServletRequest request) throws
            Exception {

        sesion = request.getSession();
        if (sesion == null)
            return false;
        else
        if (sesion.getAttribute(USUARIO) == null)
            return false;
        else
            return true;
    }

    public String getStr_idSession() {
    	str_idSession = sesion.getId();
        return str_idSession;
    }

    public void setStr_idSession(String str_idSession) {
        this.str_idSession = str_idSession;
    }
}
